package com.inspire.springboot.controller;

/**
 * @author :inspire
 * @date :Created in 2025/9/11 16:36
 * @description: https://www.tianapi.com/
 * @modified By:inspire
 * @version:
 */
import com.inspire.springboot.domain.Result;
import com.inspire.springboot.service.imp.WeatherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class WeatherController {

    @Autowired
    private WeatherService weatherService;

    @GetMapping("/weather")
    public Result getWeather(@RequestParam String city) {
        return weatherService.getWeatherByCity(city);
    }
}
